package org.example.study2;

import java.io.FileWriter;
import java.io.IOException;

public class Demo_205 {
    public static void main(String[] args) throws IOException {
        // 定义一个字符输出流
        FileWriter writer = new FileWriter("D:\\temp\\java114\\file_writer.txt");
        // 写入具体的字符
        writer.write("hello world!!!");
        writer.write('\n');// 换行符
        writer.write("你好世界！！！");
        // 强制刷新缓冲区
        writer.flush();
        // 关闭流
        writer.close();
    }
}
